#include <stdio.h>
int main()
{  	 	   		 	 	 
    int tuangou_num = 0; //已经团购人数
    int thistime_num = 0; //当前要团购人数
    int daijinquan = 0; //当前拥有的代金券
    scanf("%d,%d,%d", &tuangou_num, &thistime_num, &daijinquan);          //1
 
    int currentnum = 0;
    currentnum = tuangou_num + thistime_num; //计算之前团购人数+这次人数  //1
    double money_tuangou = 0; //使用团购的实际消费
    if (thistime_num <= 0)
    {  	 	   		 	 	 
        printf("0");
        return 0;
    }
    if (currentnum <= 50) //当当前人数超过某一当，计算折扣                //1
        money_tuangou = thistime_num * 58;                                //1
    if (currentnum >= 51 && currentnum <= 100)                            //1  
        money_tuangou = thistime_num * 58 * 0.9;
    if (currentnum >= 101 && currentnum <= 150)
        money_tuangou = thistime_num * 58 * 0.85;
    if (currentnum >= 151 && currentnum <= 200)
        money_tuangou = thistime_num * 58 * 0.8;
    if (currentnum > 200)                                                 //1  
        money_tuangou = thistime_num * 58 * 0.75;
 
    double money_daijinquan = 0; //使用代金券最后的实际消费
    money_daijinquan = 58 * thistime_num;
    if (daijinquan == 100)                                              //1 
        money_daijinquan = money_daijinquan - 10;                       //1
    if (daijinquan == 200)
        money_daijinquan = money_daijinquan - 30;
    if (daijinquan == 500)
        money_daijinquan = money_daijinquan - 80;
    if (money_tuangou < money_daijinquan)                               
        printf("1");                                                    //1
    else if (money_tuangou > money_daijinquan)                          
        printf("2");                                                    //1
    else
        printf("0");
    return 0;
}  	 	   	